<template>
  <!-- 分页组件 -->
  <div class="page">
    <el-pagination
      background
      :page-size="pageSize"
      layout="total, prev, pager, next, jumper"
      :total="total"
      @current-change="handleCurrentChange"
    ></el-pagination>
  </div>
</template>

<script>
export default {
  name: 'Pagination',
  props: {
    pageSize: {
      type: Number,
      default: 10
    },
    total: {
      type: Number,
      default: -1
    }
  },
  methods: {
    handleCurrentChange (currentPage) {
      this.$emit('page-change', currentPage)
    }
  }
}
</script>

<style lang="scss" scoped>
.page {
  text-align: center;
}
</style>
